<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>候选人员详细信息</title>
<%@ include file="/common/meta.jsp"%>
<script type="text/javascript" src="${res}/js/proposal/irisPrpPrepare.js"></script>
<script type="text/javascript" src="${res}/js/validate/irisvalidator.js"></script>
<script type="text/javascript" src="${res}/js/autodisckey/autodisckey.js"></script>
<style type="text/css">
	.input_width { width:130px }
	.select_width { width:143px }
	.table_td td {border:0}
	.long_input{ width:642px }
    .selectWidth4{width:674px;}
</style>
<script type="text/javascript">
var type = "${param.type}";
var parentTable = parent.$("#"+"${param.parentTab}");	//父页面的表格
var selectRadio = $();									//父页面选中的单选框
var selectTr = $();										//父页面选中的行

if(type=="edit") {
	selectRadio = parentTable.find(":radio:checked");
	selectTr = selectRadio.parents("tr");
}

$(function(){
	$("#fragment-tab1 :text,#fragment-tab1 [type='date']").addClass("input_width");
	$("#fragment-tab1 select").addClass("select_width");
	if(type=="edit"){
		
		$("input:not(:radio:button),textarea").each(function(){

			var id=$(this).attr("name");
			if(id==null || id=="")
				return true;
			
			var parentObj=selectTr.find("[name$='/"+id+"']");
			var value="";
			if(parentObj.is("span"))
				value=parentObj.text();
			else
				value=parentObj.val();
			//if($(this).is("input"))//初始化input框 不包括radio
				$(this).val(value);
				if($(this).is("span")){
					$(this).text(value);
				}
		});
		
		tree();
		$(":radio").each(function(){//初始化radio框
			var name=$(this).attr("name");
		
			
			var value=$("[name='"+name+"_value']").val();
			if($(this).val()==value)
				$(this).attr("checked",true);
			
		});
		
		
	$("input:not(:button:radio),textarea,select").each(function(){
		$(this).attr("disabled",true);
		$(this).attr("class","gray input_width");
	});
	$("select").each(function(){
		$(this).attr("disabled",true);
		$(this).attr("class","gray select_width");
	});
	$("input:radio").each(function(){
		$(this).attr("disabled",true);
		$(this).attr("class","gray");
	});
}
});	
function tree(){
	
	var prof_title_name=$("#prof_title_name").val(); 
	$("#prof_title").val(prof_title_name);
	$("#prof_title_tree_img").css("display","none");
	$(".inputSelectButton").css("display","none");
	var subject_name=$("#subject_name").val(); 
	$("#subject").val(subject_name);
	var discipline_name=$("#discipline_name").val(); 
	$("#discipline").val(discipline_name);
	
}
function loadAjaxSelect(selectId,url,params,varParm){
	var submitpsn=selectTr.find("[name$='submit_psn']");//标示是否是申报人
	var isAdminor=false;//根据权限判断是否是单位管理员
	<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
	isAdminor = true;
	</security:authorize>
	$.ajax( {
		url : url,
		type : 'post',
		dataType:'json',
		data : params,
		success : function(data) {
			
			for(var i=0;i<data.length;i++){
				var value=data[i].id;
				var text=data[i].name;		
				$("#"+selectId).append("<option value='"+value+"'>"+text+"</option>");
				

			}
			if(type=="edit" && selectId != "card_type"){//如果是修改，才需要初始化select框的值
				var selectValue=$("[name='"+selectId+"_value']").val();
				$("#"+selectId+" option").each(function(i,obj){
					if($(obj).val()==selectValue){
						setTimeout(function() {
							$(obj).attr("selected",true);
						}, 1);
					}
				});
			}
			if(type=="edit" && selectId == "card_type"){ 
				if(submitpsn.length>0 && submitpsn.val()=="1" && isAdminor){
					$("#"+selectId+" option").each(function(i,obj){
						if($(obj).val()==1){
							setTimeout(function() {
								$(obj).attr("selected",true);
							}, 1);
						}
					});
					$("#"+selectId).attr("disabled",true);
				}else{
					var selectValue=$("[name='"+selectId+"_value']").val();
					$("#"+selectId+" option").each(function(i,obj){
						if($(obj).val()==selectValue){
							setTimeout(function() {
								$(obj).attr("selected",true);
							}, 1);
						}
					});
				}
			}
			
			//setDegree();	
		}
	});
	}


</script>
</head>
<body>

	<div id="tabnav">
		<ul>
			<li class="down" id="tab1" onclick="changeTab(this.id)">
					<a href="###"><span>候选人信息</span></a>
			</li>
		</ul>
	</div>
	
	<div class="tab_box" id="fragment-tab1">
		<table class="t_css" width="100%" border="0" cellpadding="0" label="个人信息" cellspacing="1">
		<col width="20%;"/>
		<col width="30%;"/>
		<col width="20%;"/>
		<col width="30%;"/>
		<tr>
			<td nowrap align="right">姓名：</td>
			<td >
				<input name="zh_name"  type="text" <c:choose><c:when test="${param.parentTab=='persons'}" >required class="input_text required maxlength:25" </c:when><c:otherwise> class="input_text  maxlength:25" </c:otherwise></c:choose> value="" maxlength="25"/>
				<%-- <security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
					<span id="personselect">
					<input type="button" class="button_02" style="height: 25px; padding: 1px;" id="selectPsn" value="设置项目负责人">
					<cpt:personSelect key="personSelect" addRole="3" psnCode="${param.psnCode }" callback="selectPsnCall" bindEvent="click" bindObject="selectPsn" title="设置项目负责人" fltFile="personselector.ftl"></cpt:personSelect>
					</span>
				</security:authorize> --%>
			</td>
			<td align="right">
				性别：
			</td>
			<td>
				<input type="radio" id="gender_1" name="gender"  value="M" class="do"  onclick="initControlValue(this.id)" /><label>男</label>
				&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="radio" id="gender_2" name="gender" value="F" class="do"  onclick="initControlValue(this.id)" /><label>女</label>
				<input type="hidden" name="gender_value"  />
				<input type="hidden" name="gender_name"  />
			</td>
		</tr>
		
		<tr>
			<td align="right">
				排名：
			</td>
			<td>
				<input type="text" name="rank" class="input_text"/>
			</td>
			<td align='right'>
				出生年月：
			</td>
          	<td>
			<cpt:date id="birthday"  value="" className="required date input_width beforeToday"  name="birthday" ></cpt:date> 
		    </td>
		</tr>
		
		<tr>
			<td align="right">出生地：</td>
			<td>
				<input type="text" class="input_text"  name="birthplace" />
				
			</td>
			<td align="right">
				民族：
			</td>
			<td>
		       <cpt:select id="ethnicity"  key="nation"  cacheable="false"></cpt:select>	
				<input type="hidden" name="ethnicity_value" value="" >
				<input type="hidden" name="ethnicity_name" value="">
			</td>
			
		</tr>
		<tr>
			<td align="right">证件类型：</td>
	    	<td >
				<cpt:select id="card_type" style="width:140px" key="id_type1"  ></cpt:select>
				<input type="hidden" id="card_type_value" name="card_type_value"  >
				<input type="hidden"  name="card_type_name" value="">	
			</td>
			<td align="right">
				证件号码：
			</td>
			<td>
				<input type="text" id="card_code" name="card_code" disabled />
			</td>
		</tr>
		
		<tr>
			<td align="right">国籍：</td>
			<td>
				<cpt:select id="region" style="width:140px" key="country"  onChange="initControlValue(this.id)"></cpt:select>
				<input type="hidden" name="region_value" value="" />
				<input type="hidden" name="region_name" value="" />
			</td>
			<td align="right">行政职务：</td>
			<td>
				<input type="text" class="input_text" name="admin_post" />
			</td>
			
		</tr>
		<tr>
			<td align="right">归国人员：</td>
			<td>
         		<input type="radio" id="overseas_1" name="overseas" value="1" class="do" onclick="initControlValue(this.id);" /><label>是</label>
				&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="radio" id="overseas_2" name="overseas" value="2" class="do"  onclick="initControlValue(this.id);" /><label>否</label>
				<input type="hidden" id="overseas_value" name="overseas_value" />
				<input type="hidden" name="overseas_name"/>
				<!-- <input type="text" name="back_person" maxlength="100" /> -->
			</td>
			<td align="right">归国时间：</td>
			<td>
				<cpt:date id="back_time" value="" label="归国时间"  name="back_time" ></cpt:date>
			</td>
			
		</tr>
		
		<tr>
				<td align="right">工作单位：</td>
				<td>
					<input class="input_text" type="text" name="org_name" />
				</td>
				<td align="right">所在地：</td>
				<td>
					<input class="input_text" type="text" name="org_place" />
				</td>
		</tr>
		<tr>
			
		    <td align="right">办公电话：</td>
			<td>
				<input class="input_text" type="text" name="work_tel" />
			</td>
			
			<td align="right">通讯地址：</td>
			<td>
				<input class="input_text" type="text" name="mailing_address" />
			</td>
		</tr>
		<tr>
			<td align="right">邮政编码：</td>
			<td>
				<input class="input_text" type="text" id="mobile" name="post_code" />
			</td>
			<td align="right">电子信箱：</td>
			<td>
				<input class="input_text" type="text" name="email" />
			</td>
			
		</tr>
		<tr>
			
			<td align="right">移动电话：</td>
			<td>
				<input class="input_text" type="text" id="mobile" name="mobile" />
			</td>
			<td align="right">毕业学校：</td>
			<td>
				<input class="input_text" type="text" name="college" />
			</td>
		</tr>
		
		<tr>
			<td align="right">毕业时间：</td>
			<td>
				<cpt:date id="graduate_time"  value=""  name="graduate_time" ></cpt:date> 
			</td>
			
			<td align="right">文化程度：</td>
			<td>
				<cpt:select id="degree_education"  key="education1" onChange="initControlValue(this.id);"></cpt:select>
				<input type="hidden" name="degree_education_value"  class="required" value="">
				<input type="hidden" name="degree_education_name" value="">
				<!-- <input type="text" id="degree_education" maxlength="100" name="degree_education" class="input_text required" label="文化程度" /> -->
			</td>
		</tr>
		<tr>
			<td align="right">技术职称：</td>
			<td>
			
			<cpt:tree key="prof_title" cacheable="false" readonly="true" value="" id="prof_title" name="prof_title"  showPattern="all" shieldPattern="-1" />
			<input type="hidden" id="prof_title_value" name="prof_title_value" value="" /> 
			<input type="hidden" id="prof_title_name" name="prof_title_name" value="" />
			</td>
			<td align="right">专业、专长：</td>
		    <td>
		        <input class="input_text" type="text" name="major_work" />
		    </td>
		</tr>
		<tr>
			<td align="right">最高学位：</td>
			<td>
				<cpt:select id="educate"  key="degree" style="width:140px"></cpt:select>
				<input type="hidden" name="educate_value"   value="" >
				<input type="hidden" name="educate_name" value="">
			</td>
			<td align="right">
				党派：
			</td>
			<td>
				<cpt:select id="party1"  key="party1" onChange="initControlValue(this.id);"></cpt:select>
				<input type="hidden" name="party1_value"  class="required" value="">
				<input type="hidden" name="party1_name" value="">
				<!-- <input type="text" name="party_groupings" maxlength="100" label="党派" class="required"/> -->
			</td>
		</tr>
		
		<tr>
      		<td align="right">曾获科技奖励情况：</td>
     		<td colspan="3">
     			<textarea rows="9"  style="width:83%;" class="input_textarea  " name='award' ></textarea>
     		</td>
     	</tr>
     	<tr>
     		<td align="right">参加本项目开始时间：</td>
			<td>
				<cpt:date id="start_time"  value="" className="required date beforeTomorrow dateCompare:end_time" label="开始时间" name="start_time" ></cpt:date> 
			</td>
			<td align="right">参加本项目结束时间：</td>
			<td>
				<cpt:date id="end_time"  value="" className="required " name="end_time" ></cpt:date> 
			</td>
		</tr>
		<tr>
      		<td align="right">对本项目技术创造性贡献：</td>
     		<td colspan="3">
     			<textarea  rows="9" style="width:83%;" class="input_textarea" name='contribution'></textarea>
     		</td>
     	</tr>
	</table>
	
	<table width="100%" align="center">
		<tr>
			<td><input type="button" id="cancel" class="button_01 notdisabled" value="关闭" onclick="parent.tb_remove();">
			</td>
		</tr>
	</table>
	<br/>
	</div>

	
	
</body>

</html>
